package com.zqu.controller;

import com.zqu.pojo.InsuranceOrder;
import com.zqu.service.InsuranceOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("insuranceorder")
public class InsuranceOrderController {

    @Autowired
    private InsuranceOrderService insuranceOrderService;

    @RequestMapping("findinsuranceorder")
    @ResponseBody
    public InsuranceOrder selectById(){
        return insuranceOrderService.selectInsuranceOrderById(1);
    }

    @RequestMapping("selectlist")
    @ResponseBody
    public List<InsuranceOrder> selectlist(){
        return insuranceOrderService.selectList(new InsuranceOrder());
    }

    @RequestMapping("insertinsuranceorder")
    @ResponseBody
    public boolean insert(){
        return insuranceOrderService.insertInsuranceOrder(new InsuranceOrder());
    }

    @RequestMapping("updateinsuranceorder")
    @ResponseBody
    public boolean update(){
        return insuranceOrderService.updateInsuranceOrder(new InsuranceOrder());
    }

    @RequestMapping("deleteinsuranceorder")
    @ResponseBody
    public boolean delete(){
        return insuranceOrderService.deleteInsuranceOrder(1);
    }

    @RequestMapping("deleteinsuranceorderbyids")
    @ResponseBody
    public boolean deletebyids(){
        String[] ids = {"1","2"};
        return insuranceOrderService.deleteInsuranceOrderByIds(ids);
    }
}
